package com.hujf.flink.DataSet.bach;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;

/**
 * @Author hujf
 * @Date 2022/5/19 13:47
 * @Description TODO
 */
public class ReadCSV {
    public static void main(String[] args) throws Exception {
        ExecutionEnvironment environment = ExecutionEnvironment.getExecutionEnvironment();

        DataSet<User> input = environment.readCsvFile("D:\\java\\workspace\\flink\\workspace\\file\\user.csv")
                .fieldDelimiter(",")
                .ignoreFirstLine()
                .includeFields(false,true,true)
                .pojoType(User.class,"name","age");

        input.print();
    }


}
